package com.shanzhu.book.mapper;

import com.shanzhu.book.model.SeatReservation;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface SeatReservationMapper {
    int deleteByPrimaryKey(Long id);

    int insert(SeatReservation record);

    int insertSelective(SeatReservation record);

    SeatReservation selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(SeatReservation record);

    int updateByPrimaryKey(SeatReservation record);

    List<SeatReservation> selectAllByLimit(@Param("begin") int begin, @Param("size") int size);

    int selectCount();

    List<SeatReservation> selectAll();

    int selectCountBySearch(
            @Param("seatNumber") String seatNumber,
            @Param("location") String location,
            @Param("username") String username,
            @Param("reserveStatus") Integer reserveStatus,
            @Param("startTime") java.util.Date startTime,
            @Param("endTime") java.util.Date endTime);

    int selectCountBySearch2(Map<String, Object> params);


    List<SeatReservation> selectBySearch(
            @Param("seatNumber") String seatNumber,
            @Param("location") String location,
            @Param("username") String username,
            @Param("reserveStatus") Integer reserveStatus,
            @Param("startTime") java.util.Date startTime,
            @Param("endTime") java.util.Date endTime,
            @Param("begin") int begin,
            @Param("size") int size);

    List<SeatReservation> selectByReserveStatus(@Param("reserveStatus") Integer reserveStatus);

    List<SeatReservation> selectByUserId(@Param("userId") Long userId);

    List<SeatReservation> selectBySearch2(Map<String, Object> params);

    int checkSeatAvailability(
            @Param("seatNumber") String seatNumber,
            @Param("startTime") java.util.Date startTime,
            @Param("endTime") java.util.Date endTime);

    SeatReservation selectCurrentReservationByUserId(@Param("userId") Long userId);
}